#include<iostream>
using namespace std;
long long arr[100];
int main()
{
	arr[1] = 1;
	arr[2] = 2;
	for (int i = 3; i < 55; i++)
	{
		arr[i] = arr[i - 1] + arr[i - 2];
	}
	int n = 0;
	cin >> n;
	while (n--)
	{
		int m, n;
		cin >> m >> n;
		cout << arr[n - m] << endl;
	}
	return 0;
}